package cn.getech.data.development.mapper;

import cn.getech.data.development.model.req.search.SqlSearchLimitVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.getech.data.development.entity.BdpSqlSearchLimit;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * (BdpSqlSearchLimit)表数据库访问层
 *
 * @author makejava
 * @since 2021-09-23 13:38:08
 */
@Mapper
public interface BdpSqlSearchLimitMapper extends BaseMapper<BdpSqlSearchLimit> {

    //租户管理员返回为空，普通成员返回用户id
    Integer  isTenantAdmin(@Param("tenantId")Integer tenantId,@Param("userId")Integer userId);

    @MapKey("id")
    List<Map<Integer, String>>  adminRoleList(@Param("tenantId")Integer tenantId);

    @MapKey("id")
    List<Map<Integer, String>>  roleList(@Param("tenantId")Integer tenantId,@Param("userId")Integer userId);

    Integer sqlSearchLimit(@Param("tenantId")Integer tenantId);

    List<SqlSearchLimitVO> listDate(@Param("tenantId")Integer tenantId,@Param("userId")Integer userId);

}
